home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / Libraries / Tools Plus 2.6.1a / Tools Plus 2.6.1a Evaluat'n Kit / Compiling the Demos next >
INI File  |  1995-08-25  |  15KB  |  311 lines

  1. [Display using Geneva 12]
  2.  
  3.  
  4.  
  5. This document includes information about:
  6.   • compiling the demo application that is included with this
  7.      package
  8.   • resolving issues that may arise when compiling the demo
  9.  
  10. Please make sure you are using a version of your compiler that is compatible with this release of Tools Plus (details are in chapter 1,  “Introduction”).
  11.  
  12.  
  13.  
  14.  
  15. Compiling The THINK C Demo Application
  16. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  17. The easiest way to compile the C demo application included with Tools Plus is to have the following files in the same folder:
  18.     Demo.π
  19.     Demo.π.rsrc
  20.     Demo.c
  21.     ToolsPlus.Lib1
  22.     ToolsPlus.Lib2
  23.     ToolsPlus.Lib3
  24.     ToolsPlus.h
  25.     ToolsPlus.c
  26.     PascalStrHandles.c
  27. Double-click the Demo.π project file to launch THINK C, then run your project.
  28.  
  29.   Your project file keeps track of each file’s location as you add it to your project, so you may want to create a new project file after you have put all the Tools Plus libraries and their related files in their permanent folders.  Create a new (empty) project named “Demo.π” in the same folder as “Demo.π.rsrc” and “PascalStrHandles.c”.  Add the following files to your new project:
  30.     Segment 1:   MacTraps
  31.                         MacTraps2
  32.     Segment 2:   ANSI
  33.     Segment 3:   ToolsPlus.Lib1
  34.     Segment 4:   ToolsPlus.Lib2
  35.     Segment 5:   ToolsPlus.Lib3
  36.                         ToolsPlus.c
  37.     Segment 6:   Demo.c
  38. You can now build your project and run your application.
  39.  
  40.  
  41. Note:
  42.   Make sure you allocate sufficient memory to the debugger if you are going to run the Tools Plus demo application with the debugger on.  The Tools Plus demo was written as one large source file, making it easier to compile and study, but making it hungry for debugger memory.  Allocate at least 500K to the debugger.  If you don’t have enough memory, turn the debugger off (Project menu, deselect “Use Debugger”) when running the demo.
  43.   Your applications will likely be written in a more intelligent fashion, abandoning one large source file in favor of several smaller ones.
  44.  
  45.  
  46.  
  47. IMPORTANT! Errors when compiling the THINK C Demo…
  48. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  49.   At the time of this writing, Water’s Edge Software has made every effort to ensure that our demo application will compile successfully the first time. Unfortunately, Symantec C/C++ compilers have undergone a series of revisions and some inconsistencies have arisen between compiler versions. Fortunately, these differences are simple to resolve.
  50.  
  51.   If your compiler gives you an error that states “argument to function ‘x’ does not match prototype,” it indicates that Symantec has made a minor revision to that function’s prototype (in the error message, ‘x’ will be replaced by the function’s name). To correct this error, inspect the offending line in the source file, which is likely a line like:
  52.  
  53.     PenPat(&gray);
  54.  
  55. and revise it to match the prototype in the related header file. In the example above, the correction is as simple as changing the line to:
  56.  
  57.     PenPat(gray);        /* Remove ampersand (&) from the variable */
  58.  
  59.  
  60.   To date, all inconsistencies have been of this nature. We are sorry for the inconvenience these issues may cause you, and would like to offer our assistance if you have problems getting the demo compiled. See the “Technical Support” chapter for information on how to contact Water’s Edge Software for assistance.
  61.  
  62. ------------------------------------------------------------
  63.  
  64.  
  65. Compiling The THINK Pascal Demo Application
  66. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  67. The easiest way to compile the Pascal demo application included with Tools Plus is to have the following files in the same folder:
  68.     Demo.π
  69.     Demo.π.rsrc
  70.     Demo.p
  71.     ToolsPlus.Lib1
  72.     ToolsPlus.Lib2
  73.     ToolsPlus.Lib3
  74.     ToolsPlus.p
  75. Double-click the Demo.π project file to launch THINK Pascal, then run your project.
  76.  
  77.   Your project file keeps track of each file’s location as you add it to your project, so you may want to create a new project file after you have put all the Tools Plus libraries and their related files in their permanent folders.  Create a new project named “Demo.π” in the same folder as “Demo.π.rsrc”.  Add the following files to your new project:
  78.     Segment 1:   Runtime.Lib
  79.                         Interface.Lib
  80.     Segment 2:   ToolsPlus.Lib1
  81.     Segment 3:   ToolsPlus.Lib2
  82.     Segment 4:   ToolsPlus.Lib3
  83.                         ToolsPlus.p
  84.     Segment 5:   Sound.p
  85.                         Demo.p
  86. You can now build your project.  After the initial compile, you will notice THINK Pascal created some additional entries in your project file:
  87.     «ToolsPlus.Lib1:1»
  88.     «ToolsPlus.Lib2:1»
  89.     «ToolsPlus.Lib3:1»
  90.     «%_MethTables»
  91.     «%_SelProcs»
  92.     «%_Profiler»
  93.  
  94.   The «ToolsPlus.Lib1:1», «ToolsPlus.Lib2:1» and «ToolsPlus.Lib3:1» items contain the object code from the Tools Plus libraries, while «%_MethTables», «%_SelProcs» and «%_Profiler» items are part of THINK Pascal’s overhead (consult your THINK Pascal User Manual for details).
  95.  
  96.   Drag «ToolsPlus.Lib1:1» into the same segment as ToolsPlus.Lib1, «ToolsPlus.Lib2:1» into the same segment as ToolsPlus.Lib2, and «ToolsPlus.Lib3:1» into the same segment as ToolsPlus.Lib3.
  97.  
  98.   Drag «%_MethTables», «%_SelProcs» and «%_Profiler» to any segment that won’t be unloaded while your application is running, such as the one containing the Runtime.lib library.
  99.  
  100.   Even though the project window indicates that Segment 1 exceeds the 32k limit imposed on segments, the project will compile and run.  When you build your application, the smart linker will strip away unneeded code and significantly reduce the size of this segment.
  101.  
  102.  
  103.  
  104.  
  105. ------------------------------------------------------------
  106.  
  107.  
  108. Compiling the CodeWarrior C (68K) Demo Application
  109. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  110. The easiest way to compile the CodeWarrior C demo application included with Tools Plus is to have the following files in the same folder:
  111.     Demo.µ
  112.     Demo.π.rsrc
  113.     Demo.c
  114.     ToolsPlus.Lib
  115.     ToolsPlus.h
  116.     ToolsPlus.c
  117.     PascalStrHandles.c
  118. Double-click the Demo.µ project file to launch CodeWarrior C/C++, then run your project.
  119.  
  120.   If you are creating a new project (instead of using the one included as part of Tools Plus), copy the files “Demo.µ”, “Demo.π.rsrc” and “PascalStrHandles.c” to the folder containing your project.  Add the following files to your new project:
  121.  
  122.     Segment 1:   MacOS.Lib
  123.                         ANSI (2i) C.68K.Lib    (or equivalent)
  124.                         PASCAL.68K.Lib         (or equivalent)
  125.     Segment 2:   ToolsPlus.Lib
  126.                         ToolsPlus.c
  127.     Segment 3:   Demo.π.rsrc
  128.                         Demo.c
  129.  
  130. (Note that “PASCAL.68K.Lib” is part of your Pascal compiler.  In CodeWarrior 6, the file is named “P/RT.68K.lib”)
  131.  
  132.   You can now build your project and run your application.
  133.  
  134.  
  135.  
  136.  
  137. ------------------------------------------------------------
  138.  
  139.  
  140. Compiling the CodeWarrior Pascal (68K) Demo Application
  141. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  142. The easiest way to compile the CodeWarrior Pascal demo application included with Tools Plus is to have the following files in the same folder:
  143.     Demo.µ
  144.     Demo.π.rsrc
  145.     Demo.p
  146.     ToolsPlus.Lib
  147.     ToolsPlus.p
  148. Double-click the Demo.µ project file to launch CodeWarrior Pascal, then run your project.
  149.  
  150.   If you are creating a new project (instead of using the one included as part of Tools Plus), copy the files “Demo.µ” and “Demo.π.rsrc” to the folder containing your project.  Add the following files to your new project:
  151.  
  152.   In CodeWarrior 7…
  153.     Segment 1:   MacOS.lib
  154.                         PASCAL.68K.Lib
  155.                         MacIntf(UPI).68K.lib    (or equivalent interface)
  156.                         ANSI (2i) C.68K.Lib      (or equivalent)
  157.     Segment 2:   ToolsPlus.Lib
  158.                         ToolsPlus.p
  159.     Segment 3:   Demo.π.rsrc
  160.                         Demo.p
  161.  
  162.   In CodeWarrior 6…
  163.     Segment 1:   Pascal/MacOS.Lib
  164.                         P/RT.68K.lib
  165.                         MacIntf(UPI).68K.lib    (or equivalent interface)
  166.                         P/ANSI.68K.Lib            (or equivalent)
  167.     Segment 2:   ToolsPlus.Lib
  168.                         ToolsPlus.p
  169.     Segment 3:   Demo.π.rsrc
  170.                         Demo.p
  171.  
  172. You can now build your project and run your application.
  173.  
  174.  
  175.  
  176.  
  177. ------------------------------------------------------------
  178.  
  179.  
  180. Compiling the CodeWarrior C (PPC) Demo Application
  181. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  182. The easiest way to compile the CodeWarrior C demo application included with Tools Plus is to have the following files in the same folder:
  183.     Demo.µ
  184.     Demo.π.rsrc
  185.     Demo.c
  186.     ToolsPlus.Lib
  187.     ToolsPlus.h
  188.     ToolsPlus.c
  189.     PascalStrHandles.c
  190. Double-click the Demo.µ project file to launch CodeWarrior C/C++, then run your project.
  191.  
  192.   If you are creating a new project (instead of using the one included as part of Tools Plus), copy the files “Demo.µ”, “Demo.π.rsrc” and “PascalStrHandles.c” to the folder containing your project.  Add the following files to your new project:
  193.       Group 1:   MWCRuntime.Lib
  194.                       InterfaceLib
  195.                       ANSI C.PPC.Lib           (or equivalent)
  196.                       PASCAL.PPC.lib          (or equivalent)
  197.       Group 2:   ToolsPlus.Lib
  198.                       ToolsPlus.c
  199.       Group 3:   Demo.π.rsrc
  200.                       Demo.c
  201. (Note that the “PASCAL.PPC.lib” library is a component of your CodeWarrior Pascal compiler.  In CodeWarrior 6 it is named “P/Rt.PPC.lib”.)
  202.  
  203.   You can now build your project and run your application.
  204.  
  205.  
  206.  
  207.  
  208. ------------------------------------------------------------
  209.  
  210.  
  211. Compiling the CodeWarrior Pascal (PPC) Demo Application
  212. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  213. The easiest way to compile the CodeWarrior Pascal demo application included with Tools Plus is to have the following files in the same folder:
  214.     Demo.µ
  215.     Demo.π.rsrc
  216.     Demo.p
  217.     ToolsPlus.Lib
  218.     ToolsPlus.p
  219. Double-click the Demo.µ project file to launch CodeWarrior Pascal, then run your project.
  220.  
  221.   If you are creating a new project (instead of using the one included as part of Tools Plus), copy the files “Demo.µ” and “Demo.π.rsrc” to the folder containing your project.  Add the following files to your new project:
  222.  
  223.   In CodeWarrior 7:
  224.       Group 1:   MWCRuntime.Lib
  225.                      InterfaceLib
  226.                      MacIntf(UPI).PPC.Lib      (or equivalent interface)
  227.                      ANSI C.PPC.lib                (or equivalent)
  228.                      PASCAL.PPC.lib
  229.       Group 2:   ToolsPlus.Lib
  230.                      ToolsPlus.p
  231.       Group 3:   Demo.π.rsrc
  232.                      Demo.p
  233.  
  234.   In CodeWarrior 6:
  235.       Group 1:   MWPRuntime.Lib
  236.                      InterfaceLib
  237.                      MacIntf(UPI).PPC.Lib      (or equivalent interface)
  238.                      P/ANSI.PPC.lib               (or equivalent)
  239.                      P/Rt.PPC.lib
  240.       Group 2:   ToolsPlus.Lib
  241.                      ToolsPlus.p
  242.       Group 3:   Demo.π.rsrc
  243.                      Demo.p
  244.  
  245.  
  246.  
  247. You can now build your project and run your application.
  248.  
  249.  
  250.  
  251.  
  252. ------------------------------------------------------------
  253.  
  254.  
  255. Errors when compiling the CodeWarrior demos (or applications):
  256. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  257.   At the time of this writing, Water’s Edge Software has made every effort to ensure that our demo application will compile successfully the first time. Unfortunately, Apple (who produces the C/C++ headers and Pascal interfaces into the Macintosh’s toolbox) and Metrowerks development environments are undergoing a series of revisions. As a result, some inconsistencies may arise between compiler versions. Fortunately, these differences are simple to resolve.
  258.  
  259. Access Paths
  260. ~~~~~~~~~~
  261.   When using Tools Plus for CodeWarrior C/C++ (680x0 or PowerMac), a Pascal runtime library is required. You may have to change the Access Path (in your project’s preferences) to locate the required file. This applies to the demo application as well as the project in the “starter files” folder.
  262.  
  263. File Names
  264. ~~~~~~~~~
  265.   Metrowerks occasionally changes the names of their libraries. If your demo project (or starter project) can’t locate a file, remove the problem file from your project then add the equivalent, correctly named file. An Access Path to the correctly named file will be created automatically if it is required.
  266.  
  267. Routine Names
  268. ~~~~~~~~~~~
  269.   At the time of this writing, Apple was still revising the routine and constants names in their universal interfaces. Your compiler or linker will find these inconsistencies and bring them to your attention. If the application you are compiling uses constants that have been renamed in the new universal interfaces, you can resolve this in one of two ways:
  270.  
  271. 1) Go through your source code and replace all occurrences of the old
  272.     constant with the new constant name
  273.  
  274. 2) Define the old constant in a C/C++ header or Pascal interface file
  275.  
  276.   If the application you are compiling uses routine names that have been renamed in the new universal interfaces, the linker will discover this and report it to you. You can resolve this in one of two ways:
  277.  
  278. 1) Go through your source code and replace all occurrences of the old
  279.     routine name with the new routine name
  280.  
  281. 2) “Map” the old routine name to the new routine name used in the
  282.     newest universal interfaces. If a Tools Plus library refers to a
  283.     routine that has been renamed in the new universal interfaces,
  284.     define the old routine (so that the Tools Plus library can find it),
  285.     and have the old routine call the new routine. The following
  286.     example shows you how to do this:
  287.  
  288.        function GetCtlValue (theControl: ControlRef): INTEGER;
  289.        begin
  290.          GetCtlValue := GetControlValue(theControl)
  291.        end;
  292.  
  293.     The above example illustrates how the old GetCtlValue routine is
  294.     mapped to the new GetControlValue routine found in the universal
  295.     interfaces. Make sure that you defile the old routine with
  296.     identical parameter names and types as the new routine.
  297.  
  298. ------------------------------------------------------------
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306. Having Problems?
  307. ~~~~~~~~~~~~~
  308. If you are having problems compiling the demo or getting Tools Plus to work flawlessly, please contact Water’s Edge Software Technical Support (see the “Technical Support” chapter for details).
  309.  
  310. We pride ourselves on our product excellence and customer service, and we’d like to help you start using Tools Plus as quickly as possible!
  311.